package com.itheima.grow.controller;

import com.itheima.grow.model.info.OssFileInfo;
import com.itheima.grow.model.other.Result;
import com.itheima.grow.service.IPdfService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/pdf")
public class PdfController {

    @Resource
    private IPdfService pdfService;



    @GetMapping("/downPdf")
    public Result downPdf() throws Exception {
        OssFileInfo ossFileInfo = pdfService.generatePdf();
        return Result.success(ossFileInfo);
    }
}
